/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.beyond.platformutil.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ResourceBundle;

/**
 *
 * @author Daniel
 */
public class ConnectionDB {

    public static Connection getConnectionDB() {
        Connection conexion = null;

        try {
            ResourceBundle rb = ResourceBundle.getBundle("GeneralParams");
            
            
            Class.forName("com.mysql.jdbc.Driver");
            String servidor = rb.getString("servidor");
            String usuarioDB = rb.getString("usuarioDB");
            String passwordDB = rb.getString("password");
            conexion = DriverManager.getConnection(servidor, usuarioDB, passwordDB);
            System.out.println("[getConnectionDB] FINISH");
        } catch (ClassNotFoundException ex) {
            conexion = null;
            ex.getMessage();            
        } catch (SQLException ex) {
            conexion = null;
            ex.getMessage();
        }

        return conexion;

    }
}
